<html>
<head><meta charset="utf-8"><title>Comparing universes with cmp::min · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Comparing.20universes.20with.20cmp.3A.3Amin.html">Comparing universes with cmp::min</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="226234242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Comparing%20universes%20with%20cmp%3A%3Amin/near/226234242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Comparing.20universes.20with.20cmp.3A.3Amin.html#226234242">(Feb 13 2021 at 08:29)</a>:</h4>
<p><a href="https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_infer/infer/type_variable.rs.html#492">This</a> uses <code>cmp::min</code> to compare two <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.UniverseIndex.html"><code>UniverseIndex</code></a>es, which seems like a bug, because as the doc says universes are laid out in a tree structure, so it seems like that should be a LUB operation instead of just a min, which presupposes that the two universes are comparable. (I can file a bug for this but maybe I'm missing something and there is an invariant preventing this from getting called with incomparable universes.)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>